package sv.gob.mh.dgii.model;

// Generated Dec 10, 2007 4:52:21 PM by Hibernate Tools 3.2.0.beta7

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * IeSolicitud generated by hbm2java
 */
@Entity
@Table(name = "IE_SOLICITUD", schema = "UPET", uniqueConstraints = {})
@SequenceGenerator(name="SEQ_IE_SOLICITUD" , sequenceName="SEQ_IE_SOLICITUD")
public class IeSolicitud implements java.io.Serializable {

	// Fields    

	/**
	 * 
	 */
	private static final long serialVersionUID = -1278225264596489044L;
	private Long isolicitud;
	private IeFuente ieFuente;
	private TbPeriodicidad tbPeriodicidad;
	private String snotas;
	private Date fperiodo;
	private Date fperiodoFin;
	private Date fhingreso;
	private String cusuario;
	private Set<IeFuenteDet> ieFuenteDets = new HashSet<IeFuenteDet>(0);

	// Constructors

	/** default constructor */
	public IeSolicitud() {
	}

	/** minimal constructor */
	public IeSolicitud(Long isolicitud, Date fhingreso, String cusuario) {
		this.isolicitud = isolicitud;
		this.fhingreso = fhingreso;
		this.cusuario = cusuario;
	}

	/** full constructor */
	public IeSolicitud(Long isolicitud, IeFuente ieFuente,
			TbPeriodicidad tbPeriodicidad, String snotas, Date fperiodo,
			Date fhingreso, String cusuario, Set<IeFuenteDet> ieFuenteDets) {
		this.isolicitud = isolicitud;
		this.ieFuente = ieFuente;
		this.tbPeriodicidad = tbPeriodicidad;
		this.snotas = snotas;
		this.fperiodo = fperiodo;
		this.fhingreso = fhingreso;
		this.cusuario = cusuario;
		this.ieFuenteDets = ieFuenteDets;
	}

	// Property accessors
	/**
	@Id
	@Column(name = "I_SOLICITUD", unique = true, nullable = false, insertable = true, updatable = true, precision = 10, scale = 0)
	public Long getIsolicitud() {
		return this.isolicitud;
	}

	public void setIsolicitud(Long isolicitud) {
		this.isolicitud = isolicitud;
	}
**/

	@Id
	@Column(name = "I_SOLICITUD", unique = true, nullable = false, precision = 10, scale = 0)
	@GeneratedValue(strategy=GenerationType.AUTO, generator="SEQ_IE_SOLICITUD")
	public Long getIsolicitud() {
		return this.isolicitud;
	}
	
	public void setIsolicitud(Long isolicitud) {
		this.isolicitud = isolicitud;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "C_FUENTE", unique = false, nullable = true, insertable = true, updatable = true)
	public IeFuente getIeFuente() {
		return this.ieFuente;
	}

	public void setIeFuente(IeFuente ieFuente) {
		this.ieFuente = ieFuente;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "C_PERIODICIDAD", unique = false, nullable = true, insertable = true, updatable = true)
	public TbPeriodicidad getTbPeriodicidad() {
		return this.tbPeriodicidad;
	}

	public void setTbPeriodicidad(TbPeriodicidad tbPeriodicidad) {
		this.tbPeriodicidad = tbPeriodicidad;
	}

	@Column(name = "S_NOTAS", unique = false, nullable = true, insertable = true, updatable = true)
	public String getSnotas() {
		return this.snotas;
	}

	public void setSnotas(String snotas) {
		this.snotas = snotas;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "F_PERIODO", unique = false, nullable = false, insertable = true, updatable = true, length = 7)
	public Date getFperiodo() {
		return this.fperiodo;
	}

	public void setFperiodo(Date fperiodo) {
		this.fperiodo = fperiodo;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "FH_INGRESO", unique = false, nullable = false, insertable = true, updatable = true, length = 7)
	public Date getFhingreso() {
		return this.fhingreso;
	}

	public void setFhingreso(Date fhingreso) {
		this.fhingreso = fhingreso;
	}

	@Column(name = "C_USUARIO", unique = false, nullable = false, insertable = true, updatable = true, length = 30)
	public String getCusuario() {
		return this.cusuario;
	}

	public void setCusuario(String cusuario) {
		this.cusuario = cusuario;
	}

	@OneToMany( fetch = FetchType.LAZY, mappedBy = "ieSolicitud")
	public Set<IeFuenteDet> getIeFuenteDets() {
		return this.ieFuenteDets;
	}

	public void setIeFuenteDets(Set<IeFuenteDet> ieFuenteDets) {
		this.ieFuenteDets = ieFuenteDets;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "F_PERIODO_FIN", unique = false, nullable = false, insertable = true, updatable = true, length = 7)
	
	public Date getFperiodoFin() {
		return fperiodoFin;
	}

	public void setFperiodoFin(Date fperiodoFin) {
		this.fperiodoFin = fperiodoFin;
	}

}
